# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=ark
pkgver=20.04.3
pkgrel=0
pkgdesc="Graphical file compression/decompression utility with support for multiple formats"
arch="all !armhf" # armhf blocked by extra-cmake-modules
url="https://kde.org/applications/utilities/org.kde.ark"
license="GPL-2.0-only"
depends="lrzip zstd p7zip zip unzip unrar"
makedepends="extra-cmake-modules qt5-qtbase-dev karchive-dev kconfig-dev kcrash-dev kdbusaddons-dev kdoctools-dev ki18n-dev kiconthemes-dev kitemmodels-dev kio-dev kservice-dev kparts-dev kpty-dev kwidgetsaddons-dev libarchive-dev libzip-dev xz-dev shared-mime-info"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/release-service/$pkgver/src/ark-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	# plugins-cliunarchivertest is broken since Qt 5.11
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest -E "plugins-clirartest"
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}
sha512sums="6274483bc7cad9b8b3842a622a3f243fd5756aec147624eb9041459efd5c833e203c286412185bb105133d8c83a7503c8c7e519b8cb9cbd13830793c3429e142  ark-20.04.3.tar.xz"
